package offer;

public class erchashuSD55 {

    class Solution {
        public class TreeNode {
            int val;
            TreeNode left;
            TreeNode right;
            TreeNode(int x) { val = x; }
        }
        public int maxDepth(TreeNode root) {
            if (root==null)return 0;
            return Math.max(maxDepth(root.right),maxDepth(root.left))+1;
        }
    }
}
